entity MaskSave is

	port (
		entradaReg : in bit_vector(31 downto 0);
		entradaMem : in bit_vector(31 downto 0);
		saida : out bit_vector(31 downto 0);
		seletor : in bit_vector(1 downto 0)
	);
end MaskSave;

architecture arc_saves of MaskSave is

begin

	with seletor select
		saida <= (entradaMem(31 downto 8) &  entradaReg(7 downto 0)) when "00",
		         (entradaMem(31 downto 16) &  entradaReg(15 downto 0)) when "01",
				 entradaReg when others;	
		 		
end arc_saves;